<?php

header("Content-Type:text/html;charset=utf-8");  //设置系统的输出字符为utf-8
date_default_timezone_set("PRC");	 //设置时区（中国）
//定义常量
define("BASE_PATH", dirname(__FILE__));

//载入main.php
require_once "app/main.php";

//控制器c，数组
$arr = array('home', 'pj');

//启动
try
{
	$getc = $_GET['c'];
	$geta = $_GET['a'];
	if (empty($_GET))
	{
		$c = new Pj();
		$c->index();
	} elseif (in_array($getc, $arr))
	{
		$c = new $getc();
		$c->$geta();
	}
	else
		throw new Exception('无效控制器!');
} catch (Exception $e)
{
	view('error', array('message' => $e->getMessage()));
}
?>